﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/MasterPage/AdminMasterPage.master" AutoEventWireup="true" CodeFile="SAPFin001.aspx.cs" Inherits="Admin_SAPFin_SAPFin001" %>

<asp:Content ID="Content1" ContentPlaceHolderID="phScript" runat="Server">
    <link href="../../Plugin/font-awesome-4.2.0/css/font-awesome.min.css" rel="stylesheet" />
    <script type="text/javascript" src="/Scripts/Controls/DatePicker/WdatePicker.js""></script>
    <style type="text/css">
        .subTable {
            border: none !important;
        }

            .subTable td {
                border: none !important;
                padding-right: 8px;
            }
    </style>
    <script type="text/javascript" src="/Scripts/Controls/DatePicker/WdatePicker.js""></script>
    <script type="text/javascript">
        $(function () {
            $("i[data-hid]").each(function () {
                $(this).click(function () {
                    var did = $(this).attr("data-hid");

                    $("[data-id='" + did + "']").each(function () {
                        $(this).toggle();
                    });
                });
            });
        });

        function searchDiv() {
            $("#tbSearch").toggle("fast");
            if ($("#divButton").hasClass("open")) {
                $("#divButton").removeClass("open");
                $("#divButton").addClass("close")
            }
            else {
                $("#divButton").removeClass("close");
                $("#divButton").addClass("open")
            }

        }

        function deleteLink(id) {
            if (confirm('是否确定要批量删除此Excel中的凭证？'))
            { OpenWindow('删除', 'D', '/Admin/SAPFin/SAPFin001c.aspx?Id=' + id, 1000, 680); }
            return false;
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div style="width: 100%; min-width: 700px">
        <div class="searchBox">
            <div class="sb1">搜索条件</div>
            <div class="sb2 close" onclick="searchDiv()" id="divButton"></div>
            <table width="100%" cellspacing="2" cellpadding="2" id="tbSearch">
                <tr>
                    <td>Eccel文件名:
                    </td>
                    <td>
                        <yncWeb:yncTextBox ID="txtFileName" runat="server" />
                    </td>
                    <td>上传人:</td>
                    <td><yncWebDDL:DrpUsersLoginName ID="drpCreator" runat="server" ShowSelectedItem="true" /></td>
                    <td>上传日期:
                    </td>
                    <td>
                        <span style="color: #FF6600;">
                            <input class="Wdate textBox" style="width: 180px;" runat="server" readonly="readonly"
                                type="text" id="txtStartDate" clientidmode="Static" onfocus="WdatePicker({maxDate:'#F{$dp.$D(\'txtEndate\')||$dp.$DV(\'9998-12-31\')}'})" />&nbsp;&nbsp;至&nbsp;&nbsp;
                    <input class="Wdate textBox" runat="server" readonly="readonly" type="text" id="txtEndate"
                        clientidmode="Static" style="width: 180px;" onfocus="WdatePicker({minDate:'#F{$dp.$D(\'txtStartDate\');}',maxDate:'9998-12-31'})" />
                        </span>
                    </td>
                </tr>
                <tr>
                    <td colspan="4" align="left">
                        <asp:Button ID="Button1" runat="server" Text="查询" OnClick="btnSearch_Click" />
                    </td>
                </tr>
            </table>
        </div>
        <table width="100%" cellspacing="2" cellpadding="2" class="menu" align="left" style="margin-top:10px;">
            <td style="width:3px;">
                &nbsp;
            </td>
            <td class="td">
                <a class="upload" href="javascript:OpenWindow('SAP数据上传','A','/Admin/SAPFin/SAPFin001a.aspx?type=A',600,500)">SAP数据上传</a>
            </td>
        </table>

        <yncWeb:PagnationGrid PageSize="30" ID="pageGrid" runat="server" OnOnPageIndexChange="PageChanged">
            <HeaderTemplate>
                <table width="100%" cellspacing="0" cellpadding="0" class="pagnationtable" align="left">
                    <thead>
                        <tr>
                            <th width="40px">序号
                            </th>
                            <th width="60px" align="center">操作
                            </th>
                            <th>上传Excel文件名
                            </th>
                            <th width="80px">上传人</th>
                            <th width="160px">上传时间</th>
                            <th width="100px">总记录数</th>
                            <th width="100px">上传记录数</th>
                            <th>删除原因</th>
                        </tr>
                    </thead>
                    <tbody>
            </HeaderTemplate>
            <ItemTemplate>
                <tr>
                    <td>
                        <%# Container.ItemIndex +1+ (this.pageGrid.CurrentPage-1)*pageGrid.PageSize %>
                    </td>
                    <td>
                        <a class="aView" Style='<%#Eval(FinUploadLogMetadata.ColumnNames.IsDeleted).ToString()=="True"?"display:none":""%>' title="查看上传凭证"  href="SAPFin001b.aspx?Id=<%# Eval(FinUploadLogMetadata.ColumnNames.SapUploadId)%>" ></a>
                        <a class="aExcel" Style='<%#Eval(FinUploadLogMetadata.ColumnNames.IsDeleted).ToString()=="True"?"display:none":""%>' title="查看Excel文件"  href="../../UploadFile/SapData/<%# Eval(FinUploadLogMetadata.ColumnNames.FileName) %>" ></a>
                        <a class="aDelete" Style='<%#Eval(FinUploadLogMetadata.ColumnNames.IsDeleted).ToString()=="True"?"display:none":""%>' title="删除" onclick="deleteLink(<%#Eval(FinUploadLogMetadata.ColumnNames.SapUploadId)%>)" ></a>
                        
                        <%--<asp:LinkButton ToolTip="取消" runat="server" ID="LinkButtonDelete" CssClass="aDelete" Style='<%#Eval(FinUploadLogMetadata.ColumnNames.IsDeleted).ToString()=="True"?"display:none":""%>'
                                            OnClientClick="return confirm('是否确定要批量删除此Excel中的凭证？')" OnCommand="Delete_Command"
                                            CommandArgument='<%#Eval(FinUploadLogMetadata.ColumnNames.SapUploadId)%>'></asp:LinkButton>--%>
                    </td>
                    <td <%#Eval("IsDeleted").ToString()=="True"?"class='deleteLine'":""%> >
                        <%# Eval(FinUploadLogMetadata.ColumnNames.ExcelName) %>
                    </td>
                    <td <%#Eval("IsDeleted").ToString()=="True"?"class='deleteLine'":""%> >
                        <%# Eval(FinUploadLogMetadata.ColumnNames.CreatedBy)%>
                    </td>
                    <td <%#Eval("IsDeleted").ToString()=="True"?"class='deleteLine'":""%> >
                        <%# Eval(FinUploadLogMetadata.ColumnNames.CreateDttm)%>
                    </td>
                    <td <%#Eval("IsDeleted").ToString()=="True"?"class='deleteLine'":""%> >
                        <%# Eval(FinUploadLogMetadata.ColumnNames.AllCount)%>
                    </td>
                    <td <%#Eval("IsDeleted").ToString()=="True"?"class='deleteLine'":""%> >
                        <%# Eval(FinUploadLogMetadata.ColumnNames.NowCount)%>
                    </td>
                    <td <%#Eval("IsDeleted").ToString()=="True"?"class='deleteLine'":""%> >
                        <%# Eval(FinUploadLogMetadata.ColumnNames.DeleteReason)%>
                    </td>
                </tr>
            </ItemTemplate>
            <FooterTemplate>
                </tbody> </table>
            </FooterTemplate>
        </yncWeb:PagnationGrid>
    </div>

    <script type="text/javascript">
        $("#tbSearch").hide();
    </script>
    <script type="text/javascript">
        var index;
        function showMsg(msg) {
            alert(msg);
            window.location.href = "SAPFin001.aspx";
        }
    </script>  
    <script type="text/javascript" src="<%=ResolveUrl("~/Scripts/Controls/chosen.jquery.min.js")%>"></script>    
    <script type="text/javascript">
        $(function () {
            $("#<%=drpCreator.ClientID %>").css('width', '212px').chosen({
                max_selected_options: 1,
                no_results_text: "No Datas",
                search_contains: true,
                allow_single_deselect: false
            });
        });
    </script> 
</asp:Content>

